package examples.webstore.domainobject;

import java.util.Date;
import java.util.Map;

import examples.webstore.Database;


/**
 * <p>	The user domain object.
 * 
 * @author Maqbool Khan
 * @since jdk 1.5
 * @see
 */
public class User {
	
	/**
	 * <p>	name
	 */
	private String name;
	
	/**
	 * <p>	password
	 */
	private String password;
	
	/**
	 * <p>	address
	 */
	private String address;
	
	/**
	 * <p>	zip code
	 */
	private long zipCode;
	
	/**
	 * <p>	The last date and time at which the user added a product.
	 */
	private Date lastProductAddedOn;
		
	public User() {}
	
	/**
	 * @param name
	 * @param password
	 * @param address
	 * @param zipCode
	 */
	public User(String name, String password, String address, long zipCode) {
		this.name = name;
		this.password = password;
		this.address = address;
		this.zipCode = zipCode;
	}
	
	/**
	 * Returns users.
	 * @return Returns users.
	 */
	public static Map<String, User> getUsers() {
		return Database.users;
	}
	
	/**
	 * Returns address.
	 * @return Returns address.
	 */
	public String getAddress() {		
		return address;
	}
	
	/**
	 * Returns name.
	 * @return Returns name.
	 */
	public String getName() {		
		return name;
	}
	
	/**
	 * Returns password.
	 * @return Returns password.
	 */
	public String getPassword() {		
		return password;
	}
	
	/**
	 * Returns zipCode.
	 * @return Returns zipCode.
	 */
	public long getZipCode() {		
		return zipCode;
	}
	
	
	/**
	 * Returns lastProductAddedOn.
	 * @return Returns lastProductAddedOn.
	 */
	public Date getLastProductAddedOn() {		
		return lastProductAddedOn;
	}
}
